set(CEF_ROOT ${CMAKE_CURRENT_LIST_DIR}/../share/cef/cef_binary_118.6.10+g38848f1+chromium-118.0.5993.119_windows64/)

include_directories(${CEF_ROOT})
link_directories(${CEF_ROOT}Release)

if(WIN32)
	string(REPLACE /MDd /MTd CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
	string(REPLACE /MD /MT CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
else()
	add_compile_options(
		"-g"
		"$<$<CONFIG:DEBUG>:-O0>"
		"$<$<CONFIG:RELEASE>:-O3>"
	)
endif()

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CEF_ROOT}/cmake")

find_package(CEF REQUIRED)

add_subdirectory(${CEF_LIBCEF_DLL_WRAPPER_PATH} libcef_dll_wrapper)

add_definitions(-DNOMINMAX)

if(USE_SANDBOX AND(WIN32 OR MACROS))
  add_definitions(-DCEF_USE_SANDBOX)
  ADD_LOGICAL_TARGET("cef_sandbox_lib" "${CEF_SANDBOX_LIB_DEBUG}" "${CEF_SANDBOX_LIB_RELEASE}")
endif()

PRINT_CEF_CONFIG()